import java.util.Scanner;
public class Main {
    public static User login() {
        System.out.println("欢迎来到图书馆！");
        System.out.println("请输入您的姓名");
        Scanner p = new Scanner(System.in);
        String name = p.nextLine();
        System.out.println("请输入您的身份");
        System.out.println("1.管理员    2.普通用户");
        int choice = p.nextInt();
        if (choice == 1) {
            return new admin(name);
        } else if (choice == 2) {
            return new guest(name);
        }
        else return null;
    }
    public static void main(String[] args) {
        User user=login();
        booklist bl=new booklist();
            while(true){
                int choice=user.menu();
                user.doOperation(choice,bl);
            }
    }
}
